<template>
  <div id="app">
    <el-container>
      <el-header style="background-color: #545c64; color: white"
        ><h1>RBAC权限管理</h1></el-header
      >
      <el-container>
        <el-aside width="200px">
          <el-menu
            router
            default-active="2"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-submenu
              v-for="(item, index) in PerList"
              :key="index"
              :index="item.value"
            >
              <template slot="title">
                <span>{{ item.label }}</span>
              </template>
              <el-menu-item
                v-for="(e, i) in item.children"
                :key="i"
                :index="e.Url"
                >{{ e.label }}</el-menu-item
              >
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main><router-view /></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      PerList: [],
    };
  },
  created() {
    this.GetPerInfo();
    //this.$router.push("/bpmnadd");
  },
  methods: {
    GetPerInfo() {
      this.axios
        .get(
          "http://localhost:15670/api/RoleUser/PerPermissionDtosShow?Userid=" +
            sessionStorage.userId
        )
        .then((res) => {
          this.PerList = res.data.Data;
          console.log(this.PerList);
        });
    },
  },
};
</script>

<style>
</style>